const Controller = {}
const User = require('../models/user');

Controller.index = async (ctx, next) => {
  let username = 'Mankong'
  let password = 'abc@123'
  let displayName = '赵文强'
  let user = await User.findOne({ username, password }).exec()
  if (!user) {
    user = await User.create({ username, password, displayName })
  }
  return await ctx.render('weclome/index', {
    info: 'this is controller ',
    user: user
  })
}
module.exports = Controller